<?php
namespace User;
use Zend\ModuleManager\ModuleManager;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\ModuleManager\Feature\ServiceProviderInterface;
use Zend\Stdlib\Hydrator\ClassMethods;

class Module  implements
    AutoloaderProviderInterface,
    ConfigProviderInterface,
    ServiceProviderInterface
{
    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }

    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }

    public function getServiceConfig()
    {
        return array(
            'invokables' => array(
                'user_service' => 'User\Service\User'
            ),
            'factories' => array(
                'user_register_form'    => 'User\Factory\Form\RegisterFormFactory',
                'user_login_form'       => 'User\Factory\Form\LoginFormFactory',
                'user_module_options'   => 'User\Factory\ModuleOptionsFactory',
                'user_hydrator'         => 'User\Factory\Mapper\UserHydratorFactory',
                'user_mapper'           => 'User\Factory\UserMapperFactory',
                //'db_user_zend_db_adapter' => 'Zend\Db\Adapter\Adapter'
            ),
        );
    }
}
